/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managedbean.SLC;

import java.util.Date;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ActionEvent;
import merlion.crm.slcm.pojo.Analytics;
import merlion.crm.slcm.session.SLCSessionBeanLocal;

/**
 *
 * @author Kenn
 */
@ManagedBean (name="analyticsBean")
@ViewScoped
public class AnalyticsManagerBean {

    @EJB
    private SLCSessionBeanLocal slcBean;
    
    private List<Analytics> category;
    private List<Analytics> industry;
    private List<Analytics> customerCategory;
    private List<Analytics> customerIndustry;
    private List<Analytics> regionSales;
    private List<Analytics> industrySales;
    private List<Analytics> productSales;
    
    private Date startDate;
    private Date endDate;
    
    //-------------------------------------------------------------------------
    //                          Constructor
    //-------------------------------------------------------------------------
    public AnalyticsManagerBean() {
    }

    
    //-------------------------------------------------------------------------
    //                           Getter and Setter
    //-------------------------------------------------------------------------
    public List<Analytics> getCategory() {
        return category;
    }

    public void setCategory(List<Analytics> category) {
        this.category = category;
    }

    public List<Analytics> getIndustry() {
        return industry;
    }

    public void setIndustry(List<Analytics> industry) {
        this.industry = industry;
    }

    public List<Analytics> getCustomerCategory() {
        return customerCategory;
    }

    public void setCustomerCategory(List<Analytics> customerCategory) {
        this.customerCategory = customerCategory;
    }

    public List<Analytics> getCustomerIndustry() {
        return customerIndustry;
    }

    public void setCustomerIndustry(List<Analytics> customerIndustry) {
        this.customerIndustry = customerIndustry;
    }

    public List<Analytics> getRegionSales() {
        return regionSales;
    }

    public void setRegionSales(List<Analytics> regionSales) {
        this.regionSales = regionSales;
    }
    
    //-------------------------------------------------------------------------
    //                          Manager Bean Methods
    //-------------------------------------------------------------------------
    
    public void displayAnalytics(ActionEvent event){
        
    }
    
    public List<Analytics> getClientCategoryAnalytics(){
        
        category = slcBean.getAnalyticsClientCategory();
        return category;
        
    }
    
    public List<Analytics> getClientIndustryAnalytics(){
        
        industry = slcBean.getAnalyticsClientIndustry();
        return industry;
        
    }
    
    public List<Analytics> getCustomerIndustryAnalytics(){
        
        customerIndustry = slcBean.getAnalyticsCustomerIndustry();
        return customerIndustry;
        
    }
    
    public List<Analytics> getCustomerCategoryAnalytics(){
        
        customerCategory = slcBean.getAnalyticsCustomerCategory();
        return customerCategory;
        
    }
    
    public List<Analytics> getSalesRegionAnalytics(){
        
        regionSales = slcBean.getAnalyticsRegionSales(startDate, endDate);
        return regionSales;
        
    }
    
    public List<Analytics> getIndustryRegionAnalytics(){
        
        industrySales = slcBean.getAnalyticsIndustrySales(startDate, endDate);
        return industrySales;
        
    }
    
    public List<Analytics> getProductSalesAnalytics(){
        
        productSales = slcBean.getAnalyticsProductSales(startDate, endDate);
        return productSales;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public List<Analytics> getIndustrySales() {
        return industrySales;
    }

    public void setIndustrySales(List<Analytics> industrySales) {
        this.industrySales = industrySales;
    }

    public List<Analytics> getProductSales() {
        return productSales;
    }

    public void setProductSales(List<Analytics> productSales) {
        this.productSales = productSales;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }
    
}
